<%@ include file="includes/include.jsp" %>

<jsp:include page="includes/admin_header.jsp">
  <jsp:param name="pageTitle" value="Report" />
</jsp:include>

<style type="text/css">
  #report-table {
    border-top: solid gray 1px;
    border-left: solid gray 1px;
    width: 100%;
  }
  #report-table th, #report-table td {
    border-bottom: solid gray 1px;
    border-right: solid gray 1px;
  }
  #report-table td {
    padding: 5px 0 5px 5px;
  }
  #report-table th {
    background-color: #eee;
  }
</style>

<div id="title">
  <h2>Report</h2>
</div>

<table id="report-table" cellpadding="0" cellspacing="0">
  <tr>
    <th>Chapter name</th>
    <th>Date started</th>
    <th>Events (last 3 mo.)</th>
    <th>Events (all)</th>
    <th>Has description</th>
    <%--<th>Description</th>--%>
  </tr>
  <c:forEach var="entry" items="${model.chapterEventsCounts}">
    <c:choose>
      <c:when test="${entry.value.status == 'inactive'}">
        <tr style="background-color:#ffcccc">
      </c:when>
      <c:when test="${entry.value.status == 'active'}">
        <tr style="background-color:#ccffcc">
      </c:when>
      <c:otherwise>
        <tr>
      </c:otherwise>
    </c:choose>
      <td>
        <a href="/admin/updateChapter.jsp?id=<c:out value="${entry.value.id}"/>&t=events"><c:out value="${entry.value.name}"/></a>
      </td>
      <td>
        <fmt:formatDate pattern="yyyy-MM-dd" value="${entry.value.createdOn}"/></td>
      <td><c:out value="${entry.value.numEvents}"/></td>
      <td><c:out value="${entry.value.numEventsTotal}"/></td>
      <td>
        <c:choose>
          <c:when test="${empty entry.value.description}">
            no
          </c:when>
          <c:otherwise>
            yes
          </c:otherwise>
        </c:choose>
      </td>
      <%--<td><c:out value="${entry.value.description}"/></td>--%>
    </tr>
  </c:forEach>
</table>

<%@ include file="includes/footer.jsp" %>